﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="wfHojaRuta.aspx.cs" Inherits="webSGA.wfHojaRuta" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Hoja de Ruta - Sistema de Gestión Administrativa</title>
    <link href="bootstrap/css/bootstrap.css" rel="stylesheet" type="text/css" />
    <link href="bootstrap/css/bootstrap-responsive.css" rel="stylesheet" type="text/css" />
    <link href="bootstrap/css/docs.css" rel="stylesheet" type="text/css" />
    <link href="bootstrap/js/google-code-prettify/prettify.css" rel="stylesheet" type="text/css" />
    <link href="bootstrap/css/datepicker.css" rel="stylesheet" type="text/css" />
    <link rel="shortcut icon" href="bootstrap/ico/favicon.ico" />
    <link rel="apple-touch-icon-precomposed" sizes="144x144" href="bootstrap/ico/apple-touch-icon-144-precomposed.png" />
    <link rel="apple-touch-icon-precomposed" sizes="114x114" href="bootstrap/ico/apple-touch-icon-114-precomposed.png" />
    <link rel="apple-touch-icon-precomposed" sizes="72x72" href="bootstrap/ico/apple-touch-icon-72-precomposed.png" />
    <link rel="apple-touch-icon-precomposed" href="bootstrap/ico/apple-touch-icon-57-precomposed.png" />
</head>
<body data-spy="scroll" data-target=".bs-docs-sidebar" onkeydown = "return (event.keyCode!=13)">
    <form id="form1" runat="server" class="form-horizontal">
    <asp:ScriptManager ID="Scriptmanager1" runat="server">
    </asp:ScriptManager>
    <!--Cabecera-->
    <div class="navbar navbar-fixed-top">
        <div class="navbar-inner">
            <div class="container-fluid">
                <button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
                    <span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar">
                    </span>
                </button>
                <a class="brand" href="Default.aspx">Sistema de Gestión Administrativa</a>
                <div class="nav-collapse collapse">
                    <p class="navbar-text pull-right">
                        Conectado como
                        <asp:Label ID="lblUsuario" runat="server" Text=""></asp:Label>
                        &nbsp; | &nbsp;
                        <asp:Button ID="btnCerrarSesion" runat="server" Text="Cerrar Sesión" CssClass="btn-link"
                            OnClick="btnCerrarSesion_Click" />
                    </p>
                    <ul class="nav">
                        <li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown">Locales
                            <b class="caret"></b></a>
                            <ul class="dropdown-menu">
                                <li class="nav-header">Locales</li>
                                <li><a href="wfLocal.aspx">Mantenimiento de Locales</a></li>
                                <li><a href="wfImplementarLocal.aspx">Implementación de Locales</a></li>
                                <li class="divider"></li>
                                <li class="nav-header">Servicios</li>
                                <li><a href="#">Tipos de Servicios</a></li>
                                <li><a href="wfReciboServicio.aspx">Recibos de Servicios</a></li>
                            </ul>
                        </li>
                        <li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown">Empleados
                            <b class="caret"></b></a>
                            <ul class="dropdown-menu">
                                <li class="nav-header">Vehículos</li>
                                <li><a href="wfVehiculo.aspx">Mantenimiento de Vehículos</a></li>
                                <li class="active"><a href="wfHojaRuta.aspx">Hoja de Ruta</a></li>
                                <li class="divider"></li>
                                <li class="nav-header">Servicios</li>
                                <li><a href="wfSolicitudTaxi.aspx">Solicitud de Taxi</a></li>
                                <li><a href="#">Solicitud de Viaje</a></li>
                                <li><a href="#">Solicitud de Útiles de Oficina</a></li>
                                <li><a href="#">Solicitud de Útiles de Tarjetas Personales</a></li>
                            </ul>
                        </li>
                        <li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown">Telefonía
                            <b class="caret"></b></a>
                            <ul class="dropdown-menu">
                                <li class="nav-header">Solicitud</li>
                                <li><a href="wfSolicitudTelefonia.aspx">Solicitud de Equipo Telefónico</a></li>
                                <li><a href="wfReposicionTelefonia.aspx">Reposición de Equipo Teléfonico</a></li>
                                <li class="divider"></li>
                                <li><a href="wfEntregaEquipoTelefonico.aspx">Entrega de Equipo Telefónico</a></li>
                            </ul>
                        </li>
                        <li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown">Seguros
                            <b class="caret"></b></a>
                            <ul class="dropdown-menu">
                                <li><a href="wfSeguros.aspx">Pólizas de Seguro</a></li>
                            </ul>
                        </li>
                        <li><a href="#">Reportes</a></li>
                        <li><a href="#">Seguridad</a></li>
                    </ul>
                </div>
            </div>
        </div>
    </div>
    <!--Cuerpo-->
    <div class="container">
        <div class="row">
            <div class="span3 bs-docs-sidebar">
                <ul class="nav nav-list bs-docs-sidenav">
                    <li><a href="#empleado"><i class="icon-chevron-right"></i>Empleado</a></li>
                    <li><a href="#hoja-ruta"><i class="icon-chevron-right"></i>Hoja de Ruta</a></li>
                    <li><a href="#ruta"><i class="icon-chevron-right"></i>Ruta</a></li>
                </ul>
            </div>
            <div class="span9">
                <br />
                <asp:UpdatePanel ID="UpdatePanel2" runat="server" ClientIDMode="Static" UpdateMode="Conditional">
                    <ContentTemplate>
                        <div class="alert alert-success" id="alertaExito" runat="server" visible="False">
                            <button type="button" class="close" data-dismiss="alert">
                                &times;</button>
                            <asp:Label ID="lblExito" runat="server"></asp:Label>
                        </div>
                        <div class="alert alert-error" id="alertaError" runat="server" visible="False">
                            <button type="button" class="close" data-dismiss="alert">
                                &times;</button>
                            <asp:Label ID="lblError" runat="server"></asp:Label>
                        </div>
                    </ContentTemplate>
                </asp:UpdatePanel>
                <br />
                <asp:UpdatePanel ID="UpdatePanel1" runat="server" ClientIDMode="Static">
                    <ContentTemplate>
                        <div class="btn-group">
                            <asp:Button ID="btnNuevo" runat="server" Text="Nuevo" class="btn" OnClick="btnNuevo_Click" />
                            <asp:Button ID="btnGrabar" CssClass="btn btn-primary" runat="server" Text="Grabar"
                                OnClick="btnGrabar_Click" />
                            <asp:Button ID="btnEditar" CssClass="btn" runat="server" Text="Editar" OnClick="btnEditar_Click" /><asp:HiddenField
                                ID="hfAccion" runat="server" />
                            <asp:Button ID="btnCancelar" CssClass="btn" runat="server" Text="Cancelar" OnClick="btnCancelar_Click" />
                            <asp:Button ID="btnAprobar" CssClass="btn btn-success" runat="server" Text="Aprobar"
                                OnClick="btnAprobar_Click" />
                        </div>
                        <hr />
                        <div class="control-group span4">
                            <label class="control-label" for="txtIdHojaRuta">
                                Hoja de Ruta</label>
                            <div class="controls">
                                <asp:TextBox ID="txtIdHojaRuta" CssClass="input-small" runat="server"></asp:TextBox>
                                <asp:LinkButton ID="btnBuscarHojaRuta" runat="server" CssClass="btn" OnClick="btnBuscarHojaRuta_Click"><i class="icon-search"></i></asp:LinkButton>
                            </div>
                        </div>
                        <div class="control-group span4">
                            <label class="control-label" for="cboEstadoHojaRuta">
                                Estado</label>
                            <div class="controls">
                                <asp:DropDownList ID="cboEstadoHojaRuta" CssClass="dropdown input-medium" AutoPostBack="True"
                                    runat="server">
                                </asp:DropDownList>
                            </div>
                        </div>
                        <br />
                        <br />
                        <hr />
                        <h2 id="empleado">
                            Empleado</h2>
                        <div class="control-group span8">
                            <label class="control-label" for="txtIdEmpleado">
                                Código</label>
                            <div class="controls">
                                <asp:TextBox ID="txtIdEmpleado" CssClass="input-small uneditable-input" Enabled="False"
                                    runat="server"></asp:TextBox>
                                <asp:LinkButton ID="btnBuscarEmpleado" runat="server" CssClass="btn" OnClick="btnBuscarEmpleado_Click"><i class="icon-search"></i></asp:LinkButton>
                            </div>
                        </div>
                        <div class="control-group span8">
                            <label class="control-label" for="txtNombreEmpleado">
                                Nombre
                            </label>
                            <div class="controls">
                                <asp:TextBox ID="txtNombreEmpleado" CssClass="input-xxlarge uneditable-input" Enabled="false"
                                    runat="server"></asp:TextBox>
                            </div>
                        </div>
                        <div class="control-group span8">
                            <label class="control-label" for="txtAreaEmpleado">
                                Área
                            </label>
                            <div class="controls">
                                <asp:TextBox ID="txtAreaEmpleado" CssClass="input-xlarge uneditable-input" Enabled="false"
                                    runat="server"></asp:TextBox>
                            </div>
                        </div>
                        <div class="control-group span8">
                            <label class="control-label" for="txtPlacaVehiculo">
                                Placa</label>
                            <div class="controls">
                                <asp:TextBox ID="txtPlacaVehiculo" CssClass="input-small uneditable-input" Enabled="False"
                                    runat="server"></asp:TextBox>
                                <asp:LinkButton ID="btnBuscarVehiculo" runat="server" CssClass="btn" OnClick="btnBuscarVehiculo_Click"><i class="icon-search"></i></asp:LinkButton>
                                Combustible
                                <asp:TextBox ID="txtTipoCombustible" CssClass="input-small uneditable-input" Enabled="false"
                                    Visible="False" runat="server"></asp:TextBox>
                                <asp:TextBox ID="txtTipoCombustibleDesc" CssClass="input-medium uneditable-input"
                                    Enabled="false" runat="server"></asp:TextBox>
                                Galones/Km:
                                <asp:TextBox ID="txtGalonesKm" CssClass="input-small uneditable-input text-right"
                                    Enabled="false" runat="server"></asp:TextBox>
                            </div>
                        </div>
                        <br />
                        <br />
                        <br />
                        <br />
                        <br />
                        <br />
                        <br />
                        <br />
                        <br />
                        <br />
                        <hr />
                        <h2 id="hoja-ruta">
                            Hoja de Ruta</h2>
                        <div class="control-group span4">
                            <label class="control-label" for="txtFechaInicio">
                                Inicio Ruta</label>
                            <div class="controls">
                                <div class="input-append date">
                                    <asp:TextBox ID="txtFechaInicio" runat="server" CssClass="input-small" data-date-format="dd/mm/yyyy"></asp:TextBox>
                                    <span class="add-on"><i class="icon-calendar"></i></span>
                                </div>
                            </div>
                        </div>
                        <div class="control-group span4">
                            <label class="control-label" for="txtFechaFin">
                                Fin Ruta</label>
                            <div class="controls">
                                <div class="input-append date">
                                    <asp:TextBox ID="txtFechaFin" runat="server" CssClass="input-small" data-date-format="dd/mm/yyyy"></asp:TextBox>
                                    <span class="add-on"><i class="icon-calendar"></i></span>
                                </div>
                            </div>
                        </div>
                        <div class="control-group span4">
                            <label class="control-label" for="cboDepartamento">
                                Departamento:</label>
                            <div class="controls">
                                <asp:DropDownList ID="cboDepartamento" CssClass="dropdown" AutoPostBack="True" runat="server"
                                    OnSelectedIndexChanged="cboDepartamento_SelectedIndexChanged">
                                </asp:DropDownList>
                            </div>
                        </div>
                        <div class="control-group span4">
                            <label class="control-label" for="cboProvincia">
                                Provincia:</label>
                            <div class="controls">
                                <asp:DropDownList ID="cboProvincia" CssClass="dropdown" AutoPostBack="True" runat="server">
                                </asp:DropDownList>
                            </div>
                        </div>
                        <div class="control-group span4">
                            <label class="control-label" for="txtKmRecorrido">
                                Kilómetros Recorridos
                            </label>
                            <div class="controls">
                                <asp:TextBox ID="txtKmRecorrido" CssClass="input-medium uneditable-input text-right"
                                    Enabled="false" runat="server"></asp:TextBox>
                            </div>
                        </div>
                        <div class="control-group span4">
                            <label class="control-label" for="txtKmEmpresa">
                                Kilómetros Uso Empresa
                            </label>
                            <div class="controls">
                                <asp:TextBox ID="txtKmEmpresa" CssClass="input-medium uneditable-input text-right"
                                    Enabled="false" runat="server"></asp:TextBox>
                            </div>
                        </div>
                        <div class="control-group span4">
                            <label class="control-label" for="txtKmPersonal">
                                Kilómetros Uso Personal
                            </label>
                            <div class="controls">
                                <asp:TextBox ID="txtKmPersonal" CssClass="input-medium uneditable-input text-right"
                                    Enabled="false" runat="server"></asp:TextBox>
                            </div>
                        </div>
                        <div class="control-group span4">
                            <label class="control-label" for="txtTotalGalones">
                                Galones Asignados
                            </label>
                            <div class="controls">
                                <asp:TextBox ID="txtTotalGalones" CssClass="input-medium uneditable-input text-right"
                                    Enabled="false" runat="server"></asp:TextBox>
                            </div>
                        </div>
                        <div class="control-group span8">
                            <label class="control-label" for="txtObservaciones">
                                Observaciones
                            </label>
                            <div class="controls">
                                <asp:TextBox ID="txtObservaciones" CssClass="input-xxlarge" TextMode="MultiLine"
                                    runat="server"></asp:TextBox>
                            </div>
                        </div>
                        <br />
                        <br />
                        <br />
                        <br />
                        <br />
                        <br />
                        <br />
                        <br />
                        <br />
                        <br />
                        <br />
                        <br />
                        <br />
                        <hr />
                        <h2 id="ruta">
                            Ruta</h2>
                        <div class="control-group span8">
                            <asp:LinkButton ID="btnAgregarRuta" runat="server" CssClass="btn" OnClick="btnAgregarRuta_Click"><i class="icon-plus-sign"></i></asp:LinkButton>
                            <asp:LinkButton ID="btnQuitaRuta" runat="server" CssClass="btn" OnClick="btnQuitaRuta_Click"><i class="icon-minus-sign"></i></asp:LinkButton>
                        </div>
                        <asp:GridView ID="gvRuta" CssClass="table table-striped table-bordered table-condensed"
                            runat="server" AutoGenerateColumns="False" OnRowEditing="gvRuta_RowEditing" OnRowDataBound="gvRuta_RowDataBound"
                            OnRowCancelingEdit="gvRuta_RowCancelingEdit" OnRowUpdating="gvRuta_RowUpdating">
                            <Columns>
                                <asp:CommandField ShowEditButton="True">
                                    <ItemStyle Width="20px" />
                                </asp:CommandField>
                                <asp:TemplateField HeaderText="." HeaderStyle-Width="10px">
                                    <ItemTemplate>
                                        <asp:Label ID="lblItemG" runat="server" Text='<%#Eval("Item") %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Km. Inicial" HeaderStyle-Width="20px">
                                    <ItemTemplate>
                                        <asp:Label ID="lblKmInicialG" runat="server" Text='<%#Eval("KmInicial") %>'></asp:Label>
                                    </ItemTemplate>
                                    <EditItemTemplate>
                                        <asp:TextBox ID="txtKmInicialG" CssClass="input-small text-right" Text='<%#Eval("KmInicial") %>'
                                            runat="server"></asp:TextBox>
                                    </EditItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Km. Final" HeaderStyle-Width="20px">
                                    <ItemTemplate>
                                        <asp:Label ID="lblKmFinalG" runat="server" Text='<%#Eval("KmFinal") %>'></asp:Label>
                                    </ItemTemplate>
                                    <EditItemTemplate>
                                        <asp:TextBox ID="txtKmFinalG" CssClass="input-small text-right" Text='<%#Eval("KmFinal") %>'
                                            runat="server"></asp:TextBox>
                                    </EditItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Origen" HeaderStyle-Width="30px">
                                    <ItemTemplate>
                                        <asp:Label ID="lblDistritoOrigenG" runat="server" Text='<%#Eval("DistritoOrigen.Descripcion") %>'></asp:Label>
                                    </ItemTemplate>
                                    <EditItemTemplate>
                                        <asp:DropDownList ID="cboDistritoOrigenG" CssClass="dropdown" DataTextField="Descripcion"
                                            DataValueField="IdDistrito" runat="server">
                                        </asp:DropDownList>
                                    </EditItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Destino" HeaderStyle-Width="30px">
                                    <ItemTemplate>
                                        <asp:Label ID="lblDistritoDestinoG" runat="server" Text='<%#Eval("DistritoDestino.Descripcion") %>'></asp:Label>
                                    </ItemTemplate>
                                    <EditItemTemplate>
                                        <asp:DropDownList ID="cboDistritoDestinoG" CssClass="dropdown" DataTextField="Descripcion"
                                            DataValueField="IdDistrito" runat="server">
                                        </asp:DropDownList>
                                    </EditItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Uso Personal" HeaderStyle-Width="10px">
                                    <ItemTemplate>
                                        <asp:Label ID="lblUsoPersonalG" runat="server" Text='<%#Eval("UsoPersonal") %>'></asp:Label>
                                    </ItemTemplate>
                                    <EditItemTemplate>
                                        <asp:CheckBox ID="chkUsoPersonalG" runat="server" />
                                    </EditItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Visita" HeaderStyle-Width="40px">
                                    <ItemTemplate>
                                        <asp:Label ID="lblVisitaG" runat="server" Text='<%#Eval("Visita") %>'></asp:Label>
                                    </ItemTemplate>
                                    <EditItemTemplate>
                                        <asp:TextBox ID="txtVisitaG" CssClass="input-small" Text='<%#Eval("Visita") %>' runat="server"></asp:TextBox>
                                    </EditItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Observación" HeaderStyle-Width="40px">
                                    <ItemTemplate>
                                        <asp:Label ID="lblObservacionG" runat="server" Text='<%#Eval("Observacion") %>'></asp:Label>
                                    </ItemTemplate>
                                    <EditItemTemplate>
                                        <asp:TextBox ID="txtObservacionG" CssClass="input-small" Text='<%#Eval("Observacion") %>'
                                            runat="server"></asp:TextBox>
                                    </EditItemTemplate>
                                </asp:TemplateField>
                            </Columns>
                        </asp:GridView>
                        <asp:HiddenField ID="hfUltimoKm" runat="server" />
                        <asp:HiddenField ID="hfUltimoIdDistrito" runat="server" />
                        <asp:HiddenField ID="hfUltimoDistrito" runat="server" />
                    </ContentTemplate>
                </asp:UpdatePanel>
                <!--Modal Búsqueda de Vehículos-->
                <fieldset>
                    <div id="modalBusquedaHojaRuta" class="modal hide fade" tabindex="-1" role="dialog"
                        aria-labelledby="mlblBusquedaHojaRuta" aria-hidden="true">
                        <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                                &times;</button>
                            <h3 id="mlblBusquedaHojaRuta">
                                Consulta de Hojas de Ruta</h3>
                        </div>
                        <div class="modal-body">
                            <asp:UpdatePanel ID="UpdatePanel4" runat="server">
                                <ContentTemplate>
                                    <div class="control-group span2">
                                        <label class="control-label" for="txtPlacaConsultaHR">
                                            Placa</label>
                                        <div class="controls">
                                            <asp:TextBox ID="txtPlacaConsultaHR" CssClass="input-small" runat="server"></asp:TextBox>
                                        </div>
                                    </div>
                                    <div class="control-group span2">
                                        <label class="control-label" for="txtEmpleadoConsultaHR">
                                            Empleado</label>
                                        <div class="controls">
                                            <asp:TextBox ID="txtEmpleadoConsultaHR" CssClass="input-small" runat="server"></asp:TextBox>
                                        </div>
                                    </div>
                                    <div class="control-group span5">
                                        <label class="control-label" for="cboEstadoConsultaHR">
                                            Estado</label>
                                        <div class="controls">
                                            <asp:DropDownList ID="cboEstadoConsultaHR" CssClass="input-medium" runat="server">
                                            </asp:DropDownList>
                                        </div>
                                    </div>
                                    <div class="control-group span2">
                                        <label class="control-label">
                                            Fecha Inicio Desde</label>
                                        <div class="controls">
                                            <asp:TextBox ID="txtFechaInicioDesde" CssClass="input-small" runat="server" data-date-format="dd/mm/yyyy"></asp:TextBox>
                                        </div>
                                    </div>
                                    <div class="control-group span2">
                                        <label class="control-label">
                                            Hasta</label>
                                        <div class="controls">
                                            <asp:TextBox ID="txtFechaInicioHasta" CssClass="input-small" runat="server" data-date-format="dd/mm/yyyy"></asp:TextBox>
                                        </div>
                                    </div>
                                    <div class="control-group span2">
                                        <label class="control-label">
                                            Fecha Fin Desde</label>
                                        <div class="controls">
                                            <asp:TextBox ID="txtFechaFinDesde" CssClass="input-small" runat="server" data-date-format="dd/mm/yyyy"></asp:TextBox>
                                        </div>
                                    </div>
                                    <div class="control-group span2">
                                        <label class="control-label">
                                            Hasta</label>
                                        <div class="controls">
                                            <asp:TextBox ID="txtFechaFinHasta" CssClass="input-small" runat="server" data-date-format="dd/mm/yyyy"></asp:TextBox>
                                        </div>
                                    </div>
                                    <div class="control-group span5">
                                        <div class="controls text-right">
                                            <asp:Button ID="btnConsultarHR" CssClass="btn btn-info" runat="server" Text="Consultar"
                                                OnClick="btnConsultarHR_Click" />
                                        </div>
                                    </div>
                                    <br />
                                    <asp:GridView ID="gvConsultaHR" CssClass="table table-striped table-bordered table-condensed"
                                        runat="server" AutoGenerateColumns="False" DataKeyNames="IdHojaRuta" OnRowCommand="gvConsultaHR_RowCommand">
                                        <Columns>
                                            <asp:ButtonField CommandName="Seleccionar" ButtonType="Button" Text="Sel." ControlStyle-CssClass="btn btn-small btn-link">
                                                <ControlStyle CssClass="btn btn-small btn-link" />
                                            </asp:ButtonField>
                                            <asp:BoundField DataField="IdHojaRuta" HeaderText="Id" ReadOnly="True" />
                                            <asp:BoundField DataField="Placa" HeaderText="Placa" ReadOnly="True" />
                                            <asp:TemplateField HeaderText="Empleado">
                                                <ItemTemplate>
                                                    <asp:Label ID="lblEmpleadoHR" Text='<%# Eval("Empleado.Nombre") %>' runat="server"></asp:Label>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:BoundField DataField="FechaInicio" HeaderText="Fecha Inicio" ReadOnly="True"
                                                DataFormatString="{0:d}" />
                                            <asp:BoundField DataField="FechaFin" HeaderText="Fecha Fin" ReadOnly="True" DataFormatString="{0:d}" />
                                        </Columns>
                                    </asp:GridView>
                                </ContentTemplate>
                            </asp:UpdatePanel>
                        </div>
                        <div class="modal-footer">
                            <input id="btnCancelarConsultaHR" class="btn" type="button" data-dismiss="modal"
                                value="Salir" />
                        </div>
                    </div>
                </fieldset>
                <!--Modal Búsqueda de Vehículos-->
                <fieldset>
                    <div id="modalBusquedaVehiculo" class="modal hide fade" tabindex="-1" role="dialog"
                        aria-labelledby="mlblBusquedaVehiculo" aria-hidden="true">
                        <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                                &times;</button>
                            <h3 id="mlblBusquedaVehiculo">
                                Consulta de Vehículos</h3>
                        </div>
                        <div class="modal-body">
                            <asp:UpdatePanel ID="UpdatePanel3" runat="server">
                                <ContentTemplate>
                                    <div class="control-group">
                                        <label class="control-label" for="txtPlacaConsulta">
                                            Placa</label>
                                        <div class="controls">
                                            <asp:TextBox ID="txtPlacaConsulta" CssClass="input-medium" runat="server"></asp:TextBox>
                                        </div>
                                    </div>
                                    <div class="control-group">
                                        <label class="control-label" for="txtTarjetaPropiedadConsulta">
                                            Tarjeta de Propiedad</label>
                                        <div class="controls">
                                            <asp:TextBox ID="txtTarjetaPropiedadConsulta" CssClass="input-medium" runat="server"></asp:TextBox>
                                        </div>
                                    </div>
                                    <div class="control-group">
                                        <label class="control-label" for="txtPolizaConsulta">
                                            Póliza</label>
                                        <div class="controls">
                                            <asp:TextBox ID="txtPolizaConsulta" CssClass="input-medium" runat="server"></asp:TextBox>
                                            <asp:Button ID="btnConsultarVehiculo" CssClass="btn btn-info" runat="server" Text="Consultar"
                                                OnClick="btnConsultarVehiculo_Click" />
                                        </div>
                                    </div>
                                    <br />
                                    <asp:GridView ID="gvConsultaVehiculo" CssClass="table table-striped table-bordered table-condensed"
                                        runat="server" AutoGenerateColumns="False" DataKeyNames="Placa" runat="server"
                                        OnRowCommand="gvConsultaVehiculo_RowCommand">
                                        <Columns>
                                            <asp:ButtonField CommandName="Seleccionar" ButtonType="Button" Text="Sel." ControlStyle-CssClass="btn btn-small btn-link" />
                                            <asp:BoundField DataField="Placa" HeaderText="Placa" ReadOnly="True" />
                                            <asp:BoundField DataField="TarjetaPropiedad" HeaderText="Tarjeta de Propiedad" ReadOnly="True" />
                                            <asp:BoundField DataField="Poliza" HeaderText="Poliza" ReadOnly="True" />
                                            <asp:TemplateField HeaderText="Marca">
                                                <ItemTemplate>
                                                    <asp:Label ID="lblMarca" Text='<%# Eval("MarcaVehiculo.Descripcion") %>' runat="server"></asp:Label>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="Modelo">
                                                <ItemTemplate>
                                                    <asp:Label ID="lblModelo" Text='<%# Eval("ModeloVehiculo.Descripcion") %>' runat="server"></asp:Label>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                        </Columns>
                                    </asp:GridView>
                                </ContentTemplate>
                                <Triggers>
                                    <asp:AsyncPostBackTrigger ControlID="gvConsultaVehiculo" EventName="RowCommand" />
                                </Triggers>
                            </asp:UpdatePanel>
                        </div>
                        <div class="modal-footer">
                            <input id="btnCancelarConsultaVehiculo" class="btn" type="button" data-dismiss="modal"
                                value="Salir" />
                        </div>
                    </div>
                </fieldset>
                <!--Modal Confirmación de Grabar-->
                <fieldset>
                    <div id="modalConfirmacion" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="mlblConfirmacion"
                        aria-hidden="true">
                        <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                                &times;</button>
                            <h3 id="mlblConfirmacion">
                                Grabar Hoja de Ruta</h3>
                        </div>
                        <div class="modal-body">
                            <p>
                                ¿Está seguro de grabar los datos de la hoja de ruta?
                            </p>
                        </div>
                        <div class="modal-footer">
                            <asp:Button ID="btnSiGrabar" runat="server" Text="Si" CssClass="btn btn-primary"
                                OnClick="btnSiGrabar_Click" />
                            <input id="btnNoGrabar" class="btn" type="button" data-dismiss="modal" value="No" />
                        </div>
                    </div>
                </fieldset>
            </div>
            <hr />
            <footer>
                    <p class="muted credit">
                Peruana de Combustibles S.A. - 2013</p>
      </footer>
        </div>
    </div>
    </form>
    <script src="bootstrap/js/google-code-prettify/prettify.js" type="text/javascript"></script>
    <script src="bootstrap/js/jquery.js" type="text/javascript"></script>
    <script src="bootstrap/js/bootstrap.js" type="text/javascript"></script>
    <script src="bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
    <script src="bootstrap/js/bootstrap-dropdown.js" type="text/javascript"></script>
    <script src="bootstrap/js/bootstrap-affix.js" type="text/javascript"></script>
    <script src="bootstrap/js/bootstrap-alert.js" type="text/javascript"></script>
    <script src="bootstrap/js/bootstrap-button.js" type="text/javascript"></script>
    <script src="bootstrap/js/bootstrap-carousel.js" type="text/javascript"></script>
    <script src="bootstrap/js/bootstrap-collapse.js" type="text/javascript"></script>
    <script src="bootstrap/js/bootstrap-modal.js" type="text/javascript"></script>
    <script src="bootstrap/js/bootstrap-popover.js" type="text/javascript"></script>
    <script src="bootstrap/js/bootstrap-scrollspy.js" type="text/javascript"></script>
    <script src="bootstrap/js/bootstrap-tab.js" type="text/javascript"></script>
    <script src="bootstrap/js/bootstrap-tooltip.js" type="text/javascript"></script>
    <script src="bootstrap/js/bootstrap-transition.js" type="text/javascript"></script>
    <script src="bootstrap/js/bootstrap-typeahead.js" type="text/javascript"></script>
    <script src="bootstrap/js/html5shiv.js" type="text/javascript"></script>
    <script src="bootstrap/js/holder/holder.js" type="text/javascript"></script>
    <script src="bootstrap/js/application.js" type="text/javascript"></script>
    <script src="bootstrap/js/bootstrap-datepicker.js" type="text/javascript"></script>
    <script>
        function pageLoad() {
            $(function () {
                window.prettyPrint && prettyPrint();
                $('#txtFechaInicio').datepicker();
                $('#txtFechaFin').datepicker();
                $('#txtFechaInicioDesde').datepicker();
                $('#txtFechaInicioHasta').datepicker();
                $('#txtFechaFinDesde').datepicker();
                $('#txtFechaFinHasta').datepicker();
            });
        }

        function ToTopOfPage(sender, args) {
            setTimeout("window.scrollTo(0, 0)", 0);
        }
    </script>
</body>
</html>
